package cn.gov.pbc.gd.credit.web.controller.role;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.liu.jbase.ResultVo;
import com.liu.jbase.controller.impl.BaseControllerImpl;

import cn.gov.pbc.gd.credit.user.service.menu.IMenuService;
import cn.gov.pbc.gd.credit.user.service.role.IRoleService;
import cn.gov.pbc.gd.credit.vo.menu.ResMenuVo;
import cn.gov.pbc.gd.credit.vo.role.ResRoleVo;
import cn.gov.pbc.gd.credit.vo.role.RoleVo;

@Controller
@RequestMapping("/role")	
public class RoleController extends BaseControllerImpl<ResRoleVo, RoleVo, IRoleService> {
	
	@Autowired
	private IMenuService menuService;
	
    @RequestMapping("/add/view")
	public String addView(RoleVo vo, Model model, HttpServletRequest request) throws Exception {
		
    	ResultVo<List<ResMenuVo>> resultVo = menuService.treeMenuList(null, request);
    	model.addAttribute("result", resultVo);
    	
		return "role/add";
	}
    
    
//    @RequestMapping("/get/view")
//    public String getView(RoleVo vo, Model model,HttpServletRequest request) throws Exception {
//    	ResultVo<List<ResMenuVo>> resultVo = menuService.treeMenuList(null, request);
//    	model.addAttribute("result", resultVo);
//    	model.addAttribute("bean", roleService.find(vo, request));
//    	return "role/detail";
//    }
    
    
//    @RequestMapping("/update/view")
//    public String updateView(RoleVo vo, Model model,HttpServletRequest request) throws Exception {
//    	ResultVo<List<ResMenuVo>> resultVo = menuService.treeMenuList(null, request);
//    	model.addAttribute("result", resultVo);
//    	ResultVo<ResRoleVo> roleSult=roleService.find(vo, request);
//    	model.addAttribute("bean", roleSult);
//    	return "role/modify";
//    }
    
    
}
